<link rel="stylesheet" type="text/css" href="./public/css/homePage/list.css">
<link rel="stylesheet" type="text/css" href="./admin/public/css/list.css">
<div id="backImg"></div>
<div id="list">
	<div class="center">
	
	<?php
			if($goods){
				
				
			//========实现分页===================
			//设置参数
			$page=empty($_GET['p'])?1:$_GET['p'];//页码
			$_SESSION['page'] ='p'.'='.$page;//写入到session中
						
			$_SESSION['page'] = $_SESSION['page'].$url;
			$maxPage = 0;//一共显示多少页
			$maxRow = 0;//一共多少条
			$pagesize = 4; //每页显示多少条
			
			$sql = "select * from users".$where;
			// echo $sql;
			// exit;
			$result1 = mysqli_query($link,$sql);
			// $m = mysqli_fetch_assoc($result1);
			// echo "<pre>";
			// print_r($m);
			
			// exit;
			$maxRow = mysqli_num_rows($result1);
			
			$maxPage = ceil($maxRow/$pagesize);
			// echo $maxPage;
			// exit;
			
			if($page>$maxPage){
				$page = $maxPage;
			}
			if ($page<1){
				$page=1;
			}
			
			$limit = " limit ".($page-1)*$pagesize.",".$pagesize;
			// echo $limit;
			// exit;
			
			
			
			//========实现分页===================	
				
				
				
				
				
				
				foreach($goods as $v){
					if($v['status']==0) continue;
					echo "<a href='./index.php?c=goods&a=detail&gid=$v[gid]'><div class='goods'>";
						echo '<div>';
							echo '<div>';
								echo '<div style="width:79px;height:26px;float:right;color:#fff;font-size:12px;background:#e50150;text-align:center;line-height:26px;font-family:微软雅黑">去看看</div>';
								echo '<div style="width:79px;height:26px;float:right;color:#fff;font-size:12px;background:#169af3;text-align:center;line-height:26px;font-family:微软雅黑">'.$v['gname'].'</div>';
								echo '<div style="width:330px;height:30px;background:#9c83a1;color:#fff;font-size:12px;text-align:center;line-height:30px;margin:320px auto">oppo商城发货</div>';
							echo '</div>';
							echo "<img src='./admin/public/images/goods/$v[gpic]' />";
						echo '</div>';
						echo '<br />';
						echo "<b style='color:#666;font-size:15px;font-family:微软雅黑;position:absolute;top:406px'>$v[gdesc]</b>";
						echo '<br />';
						echo "<span style='color:#e50150;font-size:20px;font-weight:bold'>￥$v[price]</span>";
					echo '</div></a>';
				}
			}
		?>
		<div class="list-page">
			<?php
			
		// echo "<a href='./index.php?'> 首页 </a>";
		// echo "<a href='./index.php?'> 上一页 </a>";
		// echo " &nbsp; $allRows 条 $nowPage/$allPage 页 &nbsp; ";
		// echo "<a href='./index.php?'> 下一页 </a>";
		// echo "<a href='./index.php?'> 尾页 </a>";
			
			
			
			
				// if(!empty($_SESSION['fpage'])){
					// unset($_SESSION['fpage']);
					// echo "<a href='./index.php?c=goods&a=index&nowPage=1&search=$search'>首页</a>";
					// echo "<a href='./index.php?c=goods&a=index&nowPage=$prevPage'>上一页</a>";
					// echo " &nbsp; $allRows 条 $nowPage/$allPage 页 &nbsp; ";
					// echo "<a href='./index.php?c=goods&a=index&nowPage=$nextPage'>下一页</a>";
					// echo "<a href='./index.php?c=goods&a=index&nowPage=$allPage'>尾页</a>";
				// }
			?>
		</div>
	</div>
</div>



